package com.smartleanx.module.hrm.component;

import java.util.List;
import java.util.Map;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.smartleanx.framework.common.pojo.CommonResult;
import com.smartleanx.module.hrm.enums.ApiConstants;

import cn.hutool.json.JSONObject;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 自定义控件")
public interface DocComponentApi {

    String PREFIX = ApiConstants.PREFIX + "/docTemplate";

    @PostMapping(PREFIX + "/component-create")
    @Operation(summary = "新增自定义控件")
    CommonResult<Object> createComponent(@RequestBody JSONObject param);

    @PostMapping(PREFIX + "/component-delete")
    @Operation(summary = "删除自定义控件")
    CommonResult<Object> deleteComponent(@RequestBody List<Long> fieldIds);

    @PostMapping(PREFIX + "/component-update")
    @Operation(summary = "更新自定义控件")
    CommonResult<Object> updateComponent(@RequestBody Map<Long, String> fieldMap);
}
